<?php 
// Description: add task form
// Created by /task/partials/add_task view
// Variables:
//		- $project: current project 
//		- $users: user list of that project
$curr_user = Helper_Auth::instance()->get_user();
?>

<div class="list" style="display:none;">
	<table class="list add-task-sep">
		<tr class="row edit-task show">
			<td colspan="6">
				<form method="post" accept-charset="utf-8" id="add-task-form">
					<div class="wrap-edit-task">
	 					<label>
	 						<strong>Title :</strong>
	 						<input type="text" name="name" value="">
	 					</label>
	 					<label>
	 						<strong>Description :</strong>
	 						<textarea name="description"></textarea>
	 					</label>
	 					<div id="project-prop">
		 					<div class="quarter add-list">
				 				<strong>Group :</strong>
				 				<div class="options">
									<a href="#" class="trigger_x">
										<input type="text" disabled="disabled" class="group small coop topic" name="group_name" value="">
										<img class="icon1" src="#">
									</a>
									<div class="sliding">
										<input type="hidden" name="group_id" value="">
										<ul>
											<?php foreach ($lists as $l):?>
											<li class="al-made"><input name="group_id" type="checkbox" value="<?php echo $l['id']?>"><span><?php echo $l['name']?></span></li>
											<?php endforeach;?>
											<li class="add-new"><input type="text"></li>
										</ul>
									</div>
								</div>
				 			</div>
		 					<label class="quarter">
		 						<strong>Deadline :</strong>
		 						<input type="text" class="deadline small" name="deadline" value="">
		 					</label>
		 					<label class="quarter">
		 						<strong>Assign to :</strong>
		 						<select name="assign_user_id" class="assign_user_id">
		 						    <?php foreach($users as $u):?>
		 							<option value="<?php echo $u['id']?>"><?php echo $u['displayname']?></option>
		 							<?php endforeach;?>
		 						</select>
		 					</label>
		 					<label class="quarter">
		 						<strong>Priority :</strong>
		 						<select name="priority">
		 							<option value="<?php echo Helper_MyConst::PRIORITY_LOW?>">Low</option>
		 							<option value="<?php echo Helper_MyConst::PRIORITY_MEDIUM?>">Medium</option>
		 							<option value="<?php echo Helper_MyConst::PRIORITY_HIGH?>">High</option>
		 						</select>
		 					</label>
	 					</div>
	 					<label class="save">
	 						<button name="save" onClick="add_task_none_list(event, <?php echo $curr_user['id']?>)" class="save">Save</button>
			 						<a class="cancel" href="#">Cancel	</a>
		 				</label>
	 				</div>
	 				<input type="hidden" name="user_id" value="<?php echo $curr_user['id']?>">
					<?php echo form::hidden('project_id', $project['id'], array('class'=>'project_id'))?>
	 			</form>
			</td>
			<input type="hidden" name="user_displayname" value="<?php echo $curr_user['displayname']?>">
		</tr>
		
	</table>
</div>
		
<script>
$(document).ready(function(){
	$('div.add-list').add_group_task(<?php echo $project['id']?>);
});
</script>


